using System.Collections.Generic;
using Myotragus.Data.Containers;
using Myotragus.Data.Criteria;
using Myotragus.Data.Domain;

namespace Myotragus.Data.Repositories
{
	public class LocalizableWriteRepository<TEntity, TId> :
		LocalizableReadRepository<TEntity>, ILocalizableWriteRepository<TEntity, TId>
		where TEntity : IEntity<TId>
	{
		public LocalizableWriteRepository(IEntitiesContainer entities,
			ILocalizableWriteQueryBuilder<TEntity, TId> queryBuilder)
			: base(entities, queryBuilder)
		{
			QueryBuilder = queryBuilder;
		}

		protected new ILocalizableWriteQueryBuilder<TEntity, TId> QueryBuilder { get; private set; }

		public virtual void Save(int lcId, IEnumerable<TEntity> entities)
		{
			QueryBuilder.Save(lcId, entities);
		}

		public virtual void Save(int lcId, params TEntity[] entities)
		{
			QueryBuilder.Save(lcId, entities);
		}

		public virtual void Delete(IEnumerable<TEntity> entities)
		{
			QueryBuilder.Delete(entities);
		}

		public virtual void Delete(params TEntity[] entities)
		{
			QueryBuilder.Delete(entities);
		}
	}
}